<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateSlidesTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('slides', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id')->comment('主键ID');
            $table->integer('type_id')->default(0)->index('type_id')->comment('幻灯片id');
            $table->string('title', 50)->default('')->comment('幻灯片名称');
            $table->string('description')->comment('幻灯片描述');
            $table->text('content', 65535)->nullable()->comment('幻灯片内容');
            $table->string('image')->default('')->comment('幻灯片图片');
            $table->string('url')->default('')->comment('幻灯片链接');
            $table->string('target', 10)->default('')->comment('链接打开方式');
            $table->boolean('status')->default(1)->comment('状态,1:显示;2:隐藏');
            $table->boolean('sort')->default(100)->comment('排序');
            $table->timestamps();
            $table->index('type_id');
        });
    }


    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('slides');
    }

}
